<?php
require_once("includes/news.tbl.php");
require_once("viewinfo.php");

$id = $_REQUEST["id"];
if($id > 0)
{
	$pClsNews = new clsNewsTable($id);
	$title = $pClsNews->value('title');
	$content = $pClsNews->value('content');
	$listnews = $pClsNews->listobj(10);
	$arr_link = array();
	foreach($listnews as $pClsNews)
	{
		if($pClsNews->value('id') != $id)
		{
			$arr_link[$pClsNews->value('title')] = "?page=news&id=".$pClsNews->value('id');
		}
	}
	view_info1($title, $content, "Các các bản tin khác", $arr_link );
}
else
{
	$title = "Bản tin";
	$pClsNews = new clsNewsTable();
	$listnews = $pClsNews->listobj(10);
	view_list_news($title, $listnews);
}	
?>